package sdau.hjk.controller;

import sdau.hjk.entity.UserRecord;
import sdau.hjk.service.Impl.UserRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 *@version 1.0
 *@author: huangjiakai
 *@create:2021−02-16 10:30
 *@className:com.hjk.controller.UserRecordController
 *@description: TODO
 */
@Controller
@RequestMapping("/userRecord")
public class UserRecordController {
    @Autowired
    private UserRecordService userRecordService;

    //查询打卡记录
    @RequestMapping("/findById")
    @ResponseBody
    public List<UserRecord> findById(Integer id){
        List<UserRecord> userRecordList = userRecordService.findById(id);
        return userRecordList;
    }

    //打卡
    @RequestMapping("/save")
    public void save(UserRecord userRecord) throws Exception {
        userRecordService.saveUserRecord(userRecord);
    }
}
